package cn.bouncyslime.graduationProject.nba.service;

import cn.bouncyslime.graduationProject.nba.dao.PlayerDataDao;
import cn.bouncyslime.graduationProject.nba.dao.SeasonDao;
import cn.bouncyslime.graduationProject.nba.dto.*;
import cn.bouncyslime.graduationProject.nba.util.ResponseData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 张一卓
 * @date 2020/4/4 1:53
 **/
@Service
public class PlayerDataService {

    private static final Logger logger = LoggerFactory.getLogger(PlayerDataService.class);

    @Autowired
    PlayerDataDao playerDataDao;
    
    @Autowired
    SeasonDao seasonDao;

    public List<String> listAllSeason(){
        return playerDataDao.listAllSeason();
    }

    /**
     * 根据 playerId 查询该球员的所有常规赛数据，包括，场均，总计，单场最高，进阶数据
     * @param playerId
     * @return
     */
    public ResponseData listPlayerRegularData(Integer playerId) {
        List<RS_PlayerAveragingDto> playerAveragingList = null;
        List<RS_PlayerSummaryDto> playerSummaryList = null;
        List<PlayerSingleTopmostDto> playerSingleTopmostList = null;
        List<PlayerAdvancedBasicDto> playerAdvancedBasicList = null;
        List<PlayerAdvancedShootingDto> playerAdvancedShootingList = null;
        Map<String, List> map = new HashMap<>();
        try {
            playerAveragingList = playerDataDao.listRSPlayerAveragingData(playerId, null);
            playerSummaryList = playerDataDao.listRSPlayerSummaryData(playerId, null);
            playerSingleTopmostList = playerDataDao.listRSPlayerSingleTopmostData(playerId, null);
            playerAdvancedBasicList = playerDataDao.listRSPlayerAdvancedBasicData(playerId, null);
            playerAdvancedShootingList = playerDataDao.listRSPlayerAdvancedShootingData(playerId, null);
            map.put("playerAveragingData", playerAveragingList);
            map.put("playerSummaryData", playerSummaryList);
            map.put("playerSingleData", playerSingleTopmostList);
            map.put("playerAdvanceBasicData", playerAdvancedBasicList);
            map.put("playerAdvancedShootinngData", playerAdvancedShootingList);
        }catch (Exception e){
            logger.warn("系统错误 " + e.getMessage());
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(map);
    }

    /**
     * 根据 playerId 查询该球员的所有 季后赛 数据，包括，场均，总计，单场最高，进阶数据
     * @param playerId
     * @return
     */
    public ResponseData listPlayerPostData(Integer playerId) {
        List<PS_PlayerAveragingDto> playerAveragingList = null;
        List<PS_PlayerSummaryDto> playerSummaryList = null;
        List<PlayerSingleTopmostDto> playerSingleTopmostList = null;
        List<PlayerAdvancedBasicDto> playerAdvancedBasicList = null;
        List<PlayerAdvancedShootingDto> playerAdvancedShootingList = null;
        Map<String, List> map = new HashMap<>();
        try {
            playerAveragingList = playerDataDao.listPSPlayerAveragingData(playerId, null);
            playerSummaryList = playerDataDao.listPSPlayerSummaryData(playerId, null);
            playerSingleTopmostList = playerDataDao.listPSPlayerSingleTopmostData(playerId, null);
            playerAdvancedBasicList = playerDataDao.listPSPlayerAdvancedBasicData(playerId, null);
            playerAdvancedShootingList = playerDataDao.listPSPlayerAdvancedShootingData(playerId, null);
            map.put("playerAveragingData", playerAveragingList);
            map.put("playerSummaryData", playerSummaryList);
            map.put("playerSingleData", playerSingleTopmostList);
            map.put("playerAdvanceBasicData", playerAdvancedBasicList);
            map.put("playerAdvancedShootinngData", playerAdvancedShootingList);
        }catch (Exception e){
            logger.warn("系统错误 " + e.getMessage());
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(map);
    }

    /**
     * 根据 playerId 获取指定球员的 场均 数据
     * @param playerId
     * @return
     */
    public ResponseData listRSPlayerAveragingData(Integer playerId) {
        List<RS_PlayerAveragingDto> playerAveragingList = null;
        try {
            playerAveragingList = playerDataDao.listRSPlayerAveragingData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerAveragingList);
    }

    public ResponseData listRSPlayerSummaryData(Integer playerId){
        List<RS_PlayerSummaryDto> playerSummaryList = null;
        try {
            playerSummaryList = playerDataDao.listRSPlayerSummaryData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerSummaryList);
    }

    public ResponseData listRSPlayerBasicAdvData(Integer playerId){
        List<PlayerAdvancedBasicDto> playerBasicAdvList = null;
        try {
            playerBasicAdvList = playerDataDao.listRSPlayerAdvancedBasicData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerBasicAdvList);
    }

    public ResponseData listRSPlayerShootingAdvData(Integer playerId){
        List<PlayerAdvancedShootingDto> playerBasicAdvList = null;
        try {
            playerBasicAdvList = playerDataDao.listRSPlayerAdvancedShootingData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerBasicAdvList);
    }


    /**
     * 根据 playerId 获取指定球员的 场均 数据
     * @param playerId
     * @return
     */
    public ResponseData listPSPlayerAveragingData(Integer playerId) {
        List<PS_PlayerAveragingDto> playerAveragingList = null;
        try {
            playerAveragingList = playerDataDao.listPSPlayerAveragingData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerAveragingList);
    }

    public ResponseData listPSPlayerSummaryData(Integer playerId){
        List<PS_PlayerSummaryDto> playerSummaryList = null;
        try {
            playerSummaryList = playerDataDao.listPSPlayerSummaryData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerSummaryList);
    }

    public ResponseData listPSPlayerBasicAdvData(Integer playerId){
        List<PlayerAdvancedBasicDto> playerBasicAdvList = null;
        try {
            playerBasicAdvList = playerDataDao.listPSPlayerAdvancedBasicData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerBasicAdvList);
    }

    public ResponseData listPSPlayerShootingAdvData(Integer playerId){
        List<PlayerAdvancedShootingDto> playerBasicAdvList = null;
        try {
            playerBasicAdvList = playerDataDao.listPSPlayerAdvancedShootingData(playerId, null);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(playerBasicAdvList);
    }
    
    

    /**
     * 根据playerId获取指定球员的 场均 得分 数据
     * @param playerId
     * @return
     */
    public ResponseData listRSPlayerAvgScoreAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "得分");
        List<Map<String, BigDecimal>> list = null;
        try{
            list = playerDataDao.listRSPlayerAvgScore(playerId, null);
            if (ObjectUtils.isEmpty(list)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", list);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 命中率， 包括投篮命中率，三分命中率和罚球命中率
     * @param playerId
     * @return
     */
    public ResponseData listRSPlayerAvgPercentageAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中率");
        List<RS_PlayerAveragingDto> percentage = null;
        try{
            percentage = playerDataDao.listRSPlayerAvgPercentage(playerId, null);
            if (ObjectUtils.isEmpty(percentage)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", percentage);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 命中数， 包括投篮命中数，三分命中数和罚球命中数
     * @param playerId
     * @return
     */
    public ResponseData listRSPlayerAvgAmountAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中数");
        List<RS_PlayerAveragingDto> amount = null;
        try{
            amount = playerDataDao.listRSPlayerAvgAmount(playerId, null);
            if (ObjectUtils.isEmpty(amount)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", amount);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 命中数， 包括投篮出手数，三分出手数和罚球出手数
     * @param playerId
     * @return
     */
    public ResponseData listRSPlayerAvgAttemptsAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手数");
        List<RS_PlayerAveragingDto> attempts = null;
        try{
            attempts = playerDataDao.listRSPlayerAvgAttempts(playerId, null);
            if (ObjectUtils.isEmpty(attempts)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", attempts);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 篮板数，包括前场篮板和后场篮板
     * @param playerId
     * @return
     */
    public ResponseData listRSPlayerAvgReboundAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "篮板");
        List<RS_PlayerAveragingDto> rebound = null;
        try{
            rebound = playerDataDao.listRSPlayerAvgRebound(playerId, null);
            if (ObjectUtils.isEmpty(rebound)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("rebound", rebound);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerAvgOtherDataAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "篮板");
        List<RS_PlayerAveragingDto> data = null;
        try{
            data = playerDataDao.listRSPlayerAvgOtherData(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerSumPercentageAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中率");
        List<RS_PlayerSummaryDto> percentage = null;
        try{
            percentage = playerDataDao.listRSPlayerSumPercentage(playerId, null);
            if (ObjectUtils.isEmpty(percentage)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", percentage);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerSumAmountAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中数");
        List<RS_PlayerSummaryDto> amount = null;
        try{
            amount = playerDataDao.listRSPlayerSumAmount(playerId, null);
            if (ObjectUtils.isEmpty(amount)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", amount);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerSumAttemptsAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手数");
        List<RS_PlayerSummaryDto> attempts = null;
        try{
            attempts = playerDataDao.listRSPlayerSumAttempts(playerId, null);
            if (ObjectUtils.isEmpty(attempts)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", attempts);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerSumReboundAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "篮板");
        List<RS_PlayerSummaryDto> rebound = null;
        try{
            rebound = playerDataDao.listRSPlayerSumRebound(playerId, null);
            if (ObjectUtils.isEmpty(rebound)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("rebound", rebound);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerSumOtherDataAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "篮板");
        List<RS_PlayerSummaryDto> data = null;
        try{
            data = playerDataDao.listRSPlayerSumOtherData(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerBasicAdvReboundRateAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "篮板率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listRSPlayerBasicAdvReboundRate(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerBasicAdvWinShareAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "贡献率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listRSPlayerBasicAdvWinShare(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerBasicAdvEfficiencyAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "效率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listRSPlayerBasicAdvEfficiency(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("efficiency", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerBasicAdvOtherAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "效率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listRSPlayerBasicAdvOther(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerShootingAdvPercentageAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中率");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listRSPlayerShootingAdvPercentage(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerShootingAdvAmountAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中数");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listRSPlayerShootingAdvAmount(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerShootingAdvAttemptsAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手数");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listRSPlayerShootingAdvAttempts(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerShootingAdvProportionAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手占比");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listRSPlayerShootingAdvProportion(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listRSPlayerShootingAdvOtherAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "出手占比");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listRSPlayerShootingAdvOther(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerAvgScoreAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "得分");
        List<Map<String, BigDecimal>> list = null;
        try{
            list = playerDataDao.listPSPlayerAvgScore(playerId, null);
            if (ObjectUtils.isEmpty(list)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", list);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 命中率， 包括投篮命中率，三分命中率和罚球命中率
     * @param playerId
     * @return
     */
    public ResponseData listPSPlayerAvgPercentageAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中率");
        List<PS_PlayerAveragingDto> percentage = null;
        try{
            percentage = playerDataDao.listPSPlayerAvgPercentage(playerId, null);
            if (ObjectUtils.isEmpty(percentage)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", percentage);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 命中数， 包括投篮命中数，三分命中数和罚球命中数
     * @param playerId
     * @return
     */
    public ResponseData listPSPlayerAvgAmountAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中数");
        List<PS_PlayerAveragingDto> amount = null;
        try{
            amount = playerDataDao.listPSPlayerAvgAmount(playerId, null);
            if (ObjectUtils.isEmpty(amount)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", amount);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 命中数， 包括投篮出手数，三分出手数和罚球出手数
     * @param playerId
     * @return
     */
    public ResponseData listPSPlayerAvgAttemptsAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手数");
        List<PS_PlayerAveragingDto> attempts = null;
        try{
            attempts = playerDataDao.listPSPlayerAvgAttempts(playerId, null);
            if (ObjectUtils.isEmpty(attempts)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", attempts);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    /**
     * 根据 playerId 获取指定球员的 篮板数，包括前场篮板和后场篮板
     * @param playerId
     * @return
     */
    public ResponseData listPSPlayerAvgReboundAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "篮板");
        List<PS_PlayerAveragingDto> rebound = null;
        try{
            rebound = playerDataDao.listPSPlayerAvgRebound(playerId, null);
            if (ObjectUtils.isEmpty(rebound)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("rebound", rebound);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerAvgOtherDataAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "篮板");
        List<PS_PlayerAveragingDto> data = null;
        try{
            data = playerDataDao.listPSPlayerAvgOtherData(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerSumPercentageAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中率");
        List<PS_PlayerSummaryDto> percentage = null;
        try{
            percentage = playerDataDao.listPSPlayerSumPercentage(playerId, null);
            if (ObjectUtils.isEmpty(percentage)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", percentage);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerSumAmountAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中数");
        List<PS_PlayerSummaryDto> amount = null;
        try{
            amount = playerDataDao.listPSPlayerSumAmount(playerId, null);
            if (ObjectUtils.isEmpty(amount)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", amount);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerSumAttemptsAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手数");
        List<PS_PlayerSummaryDto> attempts = null;
        try{
            attempts = playerDataDao.listPSPlayerSumAttempts(playerId, null);
            if (ObjectUtils.isEmpty(attempts)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("data", attempts);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerSumReboundAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "篮板");
        List<PS_PlayerSummaryDto> rebound = null;
        try{
            rebound = playerDataDao.listPSPlayerSumRebound(playerId, null);
            if (ObjectUtils.isEmpty(rebound)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("rebound", rebound);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerSumOtherDataAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "篮板");
        List<PS_PlayerSummaryDto> data = null;
        try{
            data = playerDataDao.listPSPlayerSumOtherData(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerBasicAdvReboundRateAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "篮板率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listPSPlayerBasicAdvReboundRate(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerBasicAdvWinShareAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "贡献率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listPSPlayerBasicAdvWinShare(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerBasicAdvEfficiencyAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "效率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listPSPlayerBasicAdvEfficiency(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("efficiency", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerBasicAdvOtherAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "效率");
        List<PlayerAdvancedBasicDto> data = null;
        try{
            data = playerDataDao.listPSPlayerBasicAdvOther(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerShootingAdvPercentageAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中率");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listPSPlayerShootingAdvPercentage(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerShootingAdvAmountAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "命中数");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listPSPlayerShootingAdvAmount(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerShootingAdvAttemptsAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手数");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listPSPlayerShootingAdvAttempts(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerShootingAdvProportionAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
        response.put("dataType", "出手占比");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listPSPlayerShootingAdvProportion(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public ResponseData listPSPlayerShootingAdvOtherAllSeason(Integer playerId){
        Map<String, Object> response = new HashMap<>();
//        response.put("dataType", "出手占比");
        List<PlayerAdvancedShootingDto> data = null;
        try{
            data = playerDataDao.listPSPlayerShootingAdvOther(playerId, null);
            if (ObjectUtils.isEmpty(data)){
                return ResponseData.fail("没有查找到相关数据");
            }
            response.put("dataList", data);
        }catch (Exception e){
            logger.warn("系统错误 ");
            e.printStackTrace();
            return ResponseData.error("系统错误");
        }
        return ResponseData.success(response);
    }

    public List<Map<String, Object>> listRSTopTenAvgScore(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgScore(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenAvgRebound(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgRebound(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenAvgAssists(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgAssists(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenAvgFault(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgFault(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenAvgFoul(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgFoul(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenAvgSteal(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgSteal(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenAvgBlockShot(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopAvgBlockShot(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenEfficiencyRating(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopEfficiencyRating(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenTrueShootingPercentage(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopTrueShootingPercentage(currentSeason, 10, 0);
    }

    public List<Map<String, Object>> listRSTopTenSumScore(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumScore(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSumRebound(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumRebound(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSumAssists(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumAssists(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSumFault(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumFault(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSumFoul(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumFoul(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSumSteal(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumSteal(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSumBlockShot(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSumBlockShot(currentSeason, 10, 0);
    }

    public List<Map<String, Object>> listRSTopTenSingleScore(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleScore(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSingleRebound(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleRebound(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSingleAssists(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleAssists(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSingleFault(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleFault(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSingleFoul(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleFoul(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSingleSteal(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleSteal(currentSeason, 10, 0);
    }
    public List<Map<String, Object>> listRSTopTenSingleBlockShot(){
        String currentSeason = seasonDao.getCurrentSeason();
        return playerDataDao.listRSTopSingleBlockShot(currentSeason, 10, 0);
    }
}
